<template>
  <div>
    <el-menu
      :default-active="$route.path"
      class="el-menu-demo"
      mode="horizontal"
      @select="handleSelect"
      background-color="#FFFFFF"
      text-color="#333333"
      active-text-color="#333333"
    >
      <el-menu-item
        :index="item.menuUrl+''"
        v-for="(item,index) in menuList"
        :key="index"
      >{{item.menuName}}</el-menu-item>
    </el-menu>
  </div>
</template>
 
<script>
import { menusList } from "@/service/Api.js"; // 接口
export default {
  name: "NavMenu",
  props: ["menuList"],
  data() {
    return {
      open: true,
      showRoot: false,
      menuRoot: [
        { id: "1", name: "周报管理", menuUrl: "/" },
        { id: "2", name: "周报查看", menuUrl: "/" },
        { id: "3", name: "年报查看", menuUrl: "/" }
      ]
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      this.$router.push({ path: key });
    }
  },
  mounted() {}
};
</script>

<style scoped>
.el-menu {
  width: 15%;
  margin-top: 0.5rem;
}
.el-menu li:first-child {
  color: #333333;
  font-weight: bolder;
}
.el-menu li:hover,
.menu .is-active {
  background: #c9c9c9 !important;
}
.el-menu li {
  height: 50px;
  line-height: 50px;
}
.el-menu--horizontal > .el-menu-item {
  width: 100%;
  min-width: 100px;
  text-align: center;
}
.el-menu::after,
.el-menu::before {
  display: initial;
}
</style>


